package com.yixq.soa.service.comm.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * 住户类型枚举
 */
public enum TenantUserType {

    ROOM_OWNER(0, "业主"),
    ROOM_FAMILY(1, "家人"),
    ROOM_TENANT(2, "租客"),
    ROOM_TEMP_GUEST(3, "临时客人"),
    ROOM_HOST(4, "房东");

    private static Map<Integer, TenantUserType> map = new HashMap<Integer, TenantUserType>();

    static {
        for (TenantUserType e : TenantUserType.values()) {
            map.put(e.getTypeId(), e);
        }
    }

    private Integer typeId;
    private String name;

    TenantUserType(Integer typeId, String name) {
        this.typeId = typeId;
        this.name = name;
    }

    public static TenantUserType getName(Integer typeId) {
        return map.get(typeId);
    }

    public Integer getTypeId() {
        return typeId;
    }

    public String toString() {
        return this.name;
    }

    public String getName() {
        return this.name;
    }
}
